//    Copyright (C) Kherty.  All rights reserved.
using System.Diagnostics;
using System.Diagnostics.Contracts;
using OpenLS.Core;

namespace OpenLS.Spreadsheet
{
    class RemovedCellUndoUnit: IUndoUnit
    {
        public RemovedCellUndoUnit(Cell cell)
        {
            Contract.Requires(cell != null); 
            _cell = cell;
            _address = cell.Address;
        }

        readonly Cell _cell;
        readonly CellAddress _address;

        #region IUndoUnit Members

        public void Do()
        {
            _cell.Worksheet.AddCellAt(_cell, _address); //\\ problem here
        }

        public bool Merge(IUndoUnit unit)
        {
            return false;
        }

        #endregion
    }
}
